Lens Controller
|
VA Imaging has developed a Lens Controller to control motorized Focus/Zoom/Iris lenses. VA Imaging also sells a controller specifically designed to control a Focus Lens. This API can be used to communicate with both the the AFZ controller and the Focus controller.
The VA Imaging AFZ Lens Controller is a device developed by VRW Technology. The lens controller has support for multiple types of lenses and can controll the zoom, focus and iris functions of a camera lens through commands over a serial connection. It has the following connections:
VA Imaging also has a Lens Controller for specific focus lenses. The API mentioned below can also be used to control the Focus Lens Controller. It has the following applicable connections:
This module provides the api.LensControllerAFZ and the api.LensControllerFocus, classes for interfacing with the VA Imaging and Focus lens controller hardware over a serial connection.
The AFZ lens controller can control the focus, zoom and iris of a stepper motor lens.
The lens controller has an internal positioning system. By calibrating the lens controller, the positioning system is calibrated and the system will know the position of each motor at all times. The positionint system is used for setting and calling presets and for moving to a specific position. The lens controller supports the Pelco D protocol with the following commands:
In addition, the following custom commands are supported:
Select the type of lens connected to the lens controller (custom_select_lens_default_afz, custom_select_lens_AFZ2)
Get the type of lens the controller is configured for
Calibrate all connected motors. During calibration the maximum and minimum position of the lens is Determined. The resolution of the controller is very high, small deviation around 1% are allowed and are not visually noticable. To get the maximum position determined during calibration: Use Pelco D command to move the motor to the maximum position and call the get-position-command. The minimum position is always 0.
Get the current position of the zoom motor. The returned value is a value between max and min determined during calibration.
Set the absolute position of the zoom motor. The value should between 0 and the maximum position determined during calibration. Values larger than maximum are automatically set to maximum.
Get the current position of the zoom motor. The returned value is a value between max and min determined during calibration.
Set the absolute position of the focus motor. The value should between 0 and the maximum position determined during calibration. Values larger than maximum are automatically set to maximum.
Get the current position of the zoom motor. The returned value is a value between max and min determined during calibration.
Set the absolute position of the iris motor. The value should between 0 and the maximum position determined during calibration. Values larger than maximum are automatically set to maximum.
Set the sensitivity mode of the motors. The default is 0; 1 makes the calibration less sensitive and is used for longer cables.
Get the current sensitivity mode of the controller. 0 for default; 1 for less sensitive (used for longer cables).
When power is removed, the lens controller will be restored to its factory defaults. The store current settings command will store speed, lens type, presets, calibration values and current positions in the permanent memory of the lens controller. These values will be restored after a power cycle.
The Focus lens controller has an internal positioning system. The current position can be read from the controller.
The focus lens has an integrated position sensor that has a resolution of 16384 steps per 360 degrees rotation of the motor. Between the begin and end position of the lens are 2.93 rotations of the motor, approximately 48000 steps. When power is applied to the lens, the current position value of the lens will be reset to 0, even if the position is not at the focus far position. Focussing far will decrement the position value, meaning the position value can become negative. The get_end_positions method can be used to determine the new absolute end positions of the lens after the controller has been power-cycled.
The lens controller supports the following commands: